package ribbonconfiguration;

import com.netflix.loadbalancer.IPing;
import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import com.thyme.content.configuration.NacosSameClusterWeightedRule;
import com.thyme.content.configuration.NacosWeightedRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author thyme
 * @ClassName RibbonConfiguration
 * @Description TODO
 * @Date 2019/11/5 21:16
 */
@Configuration
public class RibbonConfiguration {

    @Bean
    public IRule ribbonRule(){
        // 实现随机选择rule规则
        return new RandomRule();

        //自定义
        //return new NacosSameClusterWeightedRule();
    }

}
